/* 文件同步器 - 主界面样式 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  height: 100vh;
  overflow: hidden;
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.18);
  border: none;
  outline: none;
  background: #f5f7fa;
  display: flex;
  flex-direction: column;
}

/* 导航栏样式已移至 navbar.css，此处不再重复定义 */

/* 标题栏 */
.titlebar {
  height: 40px;
  background: #F7F7F7;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  -webkit-app-region: drag;
  user-select: none;
  border-bottom: 1px solid #e5e7eb;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-name {
  font-weight: 600;
  font-size: 14px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f44;
}

.server-status.online .status-dot {
  background: #4f4;
}

.server-status.connecting .status-dot {
  background: #fa4;
  animation: pulse 1.5s infinite;
}

.titlebar-right {
  display: flex;
  align-items: center;
  gap: 5px;
  -webkit-app-region: no-drag;
}

.titlebar-btn {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #666;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
  position: relative;
}

.titlebar-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f44;
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* 主容器 */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.file-browser-container {
  flex: 1;
  display: flex;
  gap: 1px;
  background: #ddd;
  overflow: hidden;
}

/* 文件面板 */
.file-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  overflow: hidden;
}

.panel-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 15px;
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.panel-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.path-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #f5f5f5;
  border-color: #999;
}

.file-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-list-header {
  background: #fafafa;
  border-bottom: 1px solid #e0e0e0;
  padding: 8px 15px;
  display: flex;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

.col-name {
  flex: 1;
}

.col-size {
  width: 100px;
  text-align: right;
}

.col-modified {
  width: 150px;
}

.col-actions {
  width: 100px;
  text-align: center;
}

.file-list-body {
  flex: 1;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
}

.file-item:hover {
  background: #f5f9ff;
}

.file-item.selected {
  background: #e3f2fd;
}

.file-icon {
  font-size: 18px;
  margin-right: 8px;
}

.file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  width: 100px;
  text-align: right;
  color: #666;
  font-size: 12px;
}

.file-modified {
  width: 150px;
  color: #666;
  font-size: 12px;
}

.file-actions {
  width: 100px;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.btn-action {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #f0f0f0;
}

/* 传输队列 */
.transfer-queue-container {
  height: 250px;
  background: white;
  border-top: 2px solid #e0e0e0;
  display: flex;
  flex-direction: column;
}

.queue-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.queue-stats {
  font-size: 12px;
  color: #666;
}

.queue-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background: #f0f0f0;
  border-color: #999;
}

.transfer-list {
  flex: 1;
  overflow-y: auto;
  /* 性能优化：启用硬件加速 */
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
  will-change: scroll-position;
}

.transfer-task {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  /* 性能优化：使用contain提示浏览器优化 */
  contain: layout style paint;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.task-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.task-actions {
  display: flex;
  gap: 8px;
}

.task-btn {
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 3px;
  cursor: pointer;
}

.task-btn:hover {
  background: #f0f0f0;
}

.task-progress {
  margin-bottom: 6px;
}

.progress-bar {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease-out;
  /* 性能优化：使用transform代替width会更流畅，但这里width更直观 */
  will-change: width;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.progress-fill.paused {
  background: #ffa726;
}

.progress-fill.failed {
  background: #ef5350;
}

.progress-fill.completed {
  background: #66bb6a;
}

.task-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
}

.task-speed {
  color: #667eea;
  font-weight: 500;
}

/* 加载更多指示器 */
.load-more-indicator {
  padding: 20px 15px;
  text-align: center;
  color: #667eea;
  font-size: 13px;
  background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  margin: 10px 0;
  font-weight: 500;
  cursor: default;
  user-select: none;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

/* 通知面板 */
.notification-panel {
  position: fixed;
  right: -400px;
  top: 0;
  bottom: 9px;
  width: 380px;
  background: white;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transition: right 0.3s;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.notification-panel.show {
  right: 9px;
}

.notification-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.btn-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: #666;
}

.btn-close:hover {
  color: #333;
}

.notification-actions {
  padding: 10px 15px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 8px;
}

.notification-list {
  flex: 1;
  overflow-y: auto;
}

.notification-item {
  padding: 12px 15px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
}

.notification-item:hover {
  background: #f5f5f5;
}

.notification-item.unread {
  background: #f0f7ff;
}

.notification-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
}

.notification-content {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.notification-time {
  font-size: 11px;
  color: #999;
}

/* 设置面板 */
.settings-panel {
  position: fixed;
  right: -400px;
  top: 0;
  bottom: 9px;
  width: 380px;
  background: white;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transition: right 0.3s;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.settings-panel.show {
  right: 9px;
}

.settings-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 15px;
}

.settings-section {
  margin-bottom: 25px;
}

.settings-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.setting-item label {
  font-size: 13px;
  color: #555;
}

.setting-item input[type="number"] {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.btn {
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  background: #f0f0f0;
  border-color: #999;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 14px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 动画 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 传输过滤器 */
.transfer-filter {
  background: white;
  padding: 12px 15px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 30px;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}

.filter-tabs {
  display: flex;
  gap: 6px;
}

.filter-tab {
  padding: 6px 14px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #4b5563;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
}

.filter-tab:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.filter-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: #667eea;
}

.filter-tab.active:hover {
  background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}
